buf = input()
cnt = 1
ans = []
for i in range(1,len(buf)):
    if buf[i] == buf[i-1]:
        cnt+=1
    else:
        ans.append(cnt)
        cnt = 1
ans.append(cnt)
print(max(ans))
